home *** CD-ROM | disk | FTP | other *** search
/ Crosscountry USA Photo Safari / Crosscountry USA Photo Safari.iso / Data / cc_base / pak00_16bit_f.pk3 / common / init_game_objects.c4 < prev    next >
Text File  |  2002-12-18  |  3KB  |  64 lines

  1. {
  2.   @init_game_objects
  3.   {
  4.       resid r;
  5.     resid player1_id;
  6.     resid player2_id;
  7.     resid player1_scenario_id;
  8.     resid player2_scenario_id;
  9.     resid scenario_group_id;
  10.  
  11.       int   num_commodity;
  12.       str tmp;
  13.       
  14.       Release("game_objects");
  15.       Mark("game_objects");
  16.       
  17.     r = ResCreate("Game", "Game");
  18.  
  19.     player1_id = ResCreate("Player", "Player1" );
  20.     ResPropSetResID(r, "player_1_id", player1_id );
  21.  
  22.     player2_id = ResCreate("Player", "Player2" );
  23.       ResPropSetResID(r, "player_2_id", player2_id );
  24.  
  25.     player1_scenario_id = ResCreate("Scenario", "Player1Scenario");
  26.     ResPropSetResID(player1_id, "scenario_id", player1_scenario_id);
  27.  
  28.     player2_scenario_id = ResCreate("Scenario", "Player2Scenario");
  29.     ResPropSetResID(player2_id, "scenario_id", player2_scenario_id);
  30.  
  31.     scenario_group_id = ResCreate("ScenarioGroup","ScenarioGroup");
  32.       ResPropSetResID(scenario_group_id, "player1_scenario_id", player1_scenario_id);
  33.       ResPropSetResID(scenario_group_id, "player2_scenario_id", player2_scenario_id);
  34.           
  35.       /* create the travel log */
  36.     ResPropSetResID(ResByName("Player1"), "travel_log", ResCreateWithPropFile("StrList", "Player1TravelLog", "travellog.p"));
  37.     ResPropSetResID(ResByName("Player2"), "travel_log", ResCreateWithPropFile("StrList", "Player2TravelLog", "travellog.p"));
  38.  
  39.     /* create the photo city */
  40.     ResPropSetResID(ResByName("Player1"), "photo_city", ResCreateWithPropFile("StrList", "Player1PhotoCity", "photocity.p"));
  41.     ResPropSetResID(ResByName("Player2"), "photo_city", ResCreateWithPropFile("StrList", "Player2PhotoCity", "photocity.p"));
  42.     
  43.     /* create the photo postcard */
  44.     ResPropSetResID(ResByName("Player1"), "photo_postcard", ResCreateWithPropFile("StrList", "Player1PhotoPostcard", "photopostcard.p"));
  45.     ResPropSetResID(ResByName("Player2"), "photo_postcard", ResCreateWithPropFile("StrList", "Player2PhotoPostcard", "photopostcard.p"));
  46.     
  47.     /* create the photo commodity */
  48.     ResPropSetResID(ResByName("Player1"), "photo_commodity", ResCreateWithPropFile("StrList", "Player1PhotoCommodity", "photocommodity.p"));
  49.     ResPropSetResID(ResByName("Player2"), "photo_commodity", ResCreateWithPropFile("StrList", "Player2PhotoCommodity", "photocommodity.p"));
  50.  
  51.     num_commodity = 12;
  52.     while (num_commodity > 0) {
  53.       tmp = StrFormatStr("commodity_%d", num_commodity);
  54.       ResPropSetResID(player1_id, tmp, ResCreate("Commodity",StrFormatStr("player1_commodity_%d", num_commodity)));
  55.       ResPropSetResID(player2_id, tmp, ResCreate("Commodity",StrFormatStr("player2_commodity_%d", num_commodity)));
  56.       num_commodity -=  1;
  57.     }
  58.     ResPropSetResID(player1_id, "commodity_bonus", ResCreate("Commodity","player1_commodity_bonus"));
  59.     ResPropSetResID(player2_id, "commodity_bonus", ResCreate("Commodity","player2_commodity_bonus"));
  60.   }
  61. }
  62.  
  63.     
  64.